//多语言切换
		function lg(){
			var lang = $.cookie('think_language');
			var l='zh_CN';
			if(lang =="en-us")
        {l='en';}
       else if(lang =="zh-tw"){
        l = 'zh_TW';
        }else{
        l = 'zh_CN';
        }
        return l;
        }
$(document).ready(function(){	
	//分类节点	
	$('.expandable').toggle(
		function(){
			$('.sub_'+$(this).attr('id')).hide();
			$(this).attr('src','./PUBLIC/statics/images/tv-expandable.gif');
		},
		function(){
			$('.sub_'+$(this).attr('id')).show();
			$(this).attr('src','./PUBLIC/statics/images/tv-collapsable.gif');
		}
	);

	//全反选
	$("#checkall").click(function(){
		$("input[name='id[]']").each(function(){
			if(this.checked == false){
				this.checked = true;
			}
			else{
				this.checked = false;
			}			
		});
	});
	
});


//切换
function SwapTab(name,cls_show,cls_hide,cnt,cur){
    for(var i=1;i<=cnt;i++){
		if(i==cur){
			 $('#div_'+name+'_'+i).show();
			 $('#tab_'+name+'_'+i).attr('class',cls_show);
		}else{
			 $('#div_'+name+'_'+i).hide();
			 $('#tab_'+name+'_'+i).attr('class',cls_hide);
		}
	}
}

//删除操作
function check(){
	var sucin = 0;
	$("input[name='id[]']:checked").each(function(i, n){
		sucin = 1;
	});
	if(sucin == 0){
		alert("请选择要删除的ID");
		return false;
	}else{
		return confirm('确认删除？');
		return true;		
	}
}

//滚动条
$(function(){
	$(":text").addClass('input-text');
});

/**
 * 全选checkbox,注意：标识checkbox id固定为为check_box
 * @param string name 列表check名称,如 uid[]
 */
function selectall(name) {
	if ($("#check_box").attr("checked")==false) {
		$("input[name='"+name+"']").each(function() {
			this.checked=false;
		});
	} else {
		$("input[name='"+name+"']").each(function() {
			this.checked=true;
		});
	}
}

//左侧导航
function left(url){
	leftfra.show(url);
}
function show(url){
	location.href = url;
}
//左侧导航缩放
function showHide(objname){
$(objname).toggleClass("none");  
}
$(function(){
$('.menu dl dt a').toggle(function(){
  $(this).css('background-image','url(Public/images/admin/ico-plus.png)');
},function(){
$(this).css('background-image','url(Public/images/admin/ico-jan.png)');
});
//隔行换色
$(".table tr").each(function(i){this.style.backgroundColor=['#EAF0F7','#FFF'][i%2]}) ;
}); 

